#include "synapse.h"

synapse::synapse(){
  f_signal = 0.;
  b_signal = 0.;
  weight   = 1;
  for(int icount = 0; icount < MAX_STUDY_SIGNAL_BUFFER; icount ++)
  {
    f_signal_study[icount] = 0.0;
    b_signal_study[icount] = 0.0;
    weight_back[icount]    = 0.0;
  }
}

synapse::synapse(const double &fs, const double &bs, const double &w){
  f_signal = fs;
  b_signal = bs;
  weight   = w;
  for(int icount = 0; icount < MAX_STUDY_SIGNAL_BUFFER; icount ++)
  {
    f_signal_study[icount] = 0.0;
    b_signal_study[icount] = 0.0;
    weight_back[icount]    = 0.0;
  }
}

synapse::synapse(const synapse &s){
  f_signal = s.f_signal;
  b_signal = s.b_signal;
  weight   = s.weight;

  for(int icount = 0; icount < MAX_STUDY_SIGNAL_BUFFER; icount ++)
  {
    f_signal_study[icount] = s.f_signal_study[icount];
    b_signal_study[icount] = s.b_signal_study[icount];
    weight_back[icount]    = s.weight_back[icount];
  }
}

synapse::~synapse(void){
}

void synapse::setFSignal(double s){
  f_signal = s;
}

double synapse::getFSignal(void){
  return f_signal;
}

void synapse::setBSignal(double s){
  b_signal = s;
}

double synapse::getBSignal(void){
  return b_signal;
}
void synapse::setWeight(double v) {
  weight = v;
}

double synapse::getWeight() {
  return weight;
}

void synapse::setFSignalStudy(int signalid, double value)
{
  f_signal_study[signalid] = value;
}

void synapse::setBSignalStudy(int signalid, double value)
{
  b_signal_study[signalid] = value;
}

void synapse::setWeightBack(int signalid, double value)
{
  weight_back[signalid] = value;
}

double synapse::getFSignalStudy(int signalid)
{
  return f_signal_study[signalid];
}

double synapse::getBSignalStudy(int signalid)
{
  return b_signal_study[signalid];
}

double synapse::getWeightBack(int signalid)
{
  return weight_back[signalid];
}
